package com.xbongbong.saas.enums.dictionary;

import lombok.Getter;

import java.util.Objects;

/**
 * @author: 汪腾伟
 * @date: 2020/8/28
 * @desrcption: 阿拉伯数字与中文数字的转化
 * @version:1.0
 */
@Getter
public enum DayEnum {

    DAY_ONE(1, "一"),
    DAY_SEN(2, "二"),
    DAY_THREE(3, "三"),
    DAY_FOUR(4, "四"),
    DAY_FIVE(5, "五"),
    DAY_SIX(6, "六"),
    DAY_SEVEN(7, "日");

    private int number;
    private String numberStr;

    DayEnum(int number, String numberStr) {
        this.number = number;
        this.numberStr = numberStr;
    }

    public static String getByNumberStr(int number) {
        for (DayEnum dayEnum : values()) {
            if (Objects.equals(dayEnum.number, number)) {
                return dayEnum.numberStr;
            }
        }
        return null;
    }

}
